<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>使用set实现数组去重</title>
</head>
<body>
    <script>
        const arr = [1,2,3,4,2,5,6,5,6,1,7,8]
        const b = Array.from(new Set(arr))   //  Set 删除重复项 输出对象  Array.from  转回 数组
        console.log(b)
    </script>
</body>
</html>